check if date has passed php

35

$date = new DateTime($event['date']);
$now = new DateTime();

if($date < $now) {
    echo 'date is in the past';
}

Comments

Submit
0 Comments